import request from "@/utils/request";

/**
 * @description 会员升级列表
 * @param params
 * @returns {*}
 */
export function list(params) {
    return request({
        url: '/membershipConfiguration/getMembershipConfigurationList',
        method: 'GET',
        params
    })
}

/**
 * @description 新增/编辑
 * @param data
 * @returns {*}
 */
export function save(data) {
    return request({
        url: '/membershipConfiguration/saveMembershipConfiguration',
        method: 'POST',
        data
    })
}

/**
 * @description 删除
 * @param data
 * @returns {*}
 */
export function deleteRow(data) {
    return request({
        url: '/membershipConfiguration/saveMembershipConfiguration',
        method: 'POST',
        data
    })

}

/**
 * @description 详情
 * @param id
 * @returns {*}
 */
export function detail(id) {
    return request({
        url: '/membershipConfiguration/getMembershipConfigurationById',
        method: 'GET',
        params: {id}
    })
}

/**
 * @description 更新状态
 * @param id
 * @param status
 * @returns {*}
 */
export function updateStatus(id, status) {
    return request({
        url: '/statusDemo',
        method: 'GET',
        params: {id, status}
    })
}

/**
 * @description 会员权益列表
 * @param params
 * @returns {*}
 */
export function rightsList(params) {
    return request({
        url: '/membershipPrivilegeConfig/getMembershipPrivilegeConfigList',
        method: 'GET',
        params
    })
}

/**
 * @description 会员权益删除
 * @param data
 * @returns {*}
 */
export function deleteRightsRow(data) {
    return request({
        url: '/membershipPrivilegeConfig/saveMembershipPrivilegeConfig',
        method: 'POST',
        data
    })

}

/**
 * @description 会员权益详情
 * @param id
 * @returns {*}
 */
export function rightsDetail(id) {
    return request({
        url: '/membershipPrivilegeConfig/getMembershipPrivilegeConfigById',
        method: 'GET',
        params: {id}
    })
}

/**
 * @description 会员权益新增/编辑
 * @param data
 * @returns {*}
 */
export function saveRights(data) {
    return request({
        url: '/membershipPrivilegeConfig/saveMembershipPrivilegeConfig',
        method: 'POST',
        data
    })
}

export function uploadRightsIcon(data){
    return request({
        url:'/file/upload',
        method:'POST',
        data
    })
}

/**
 * @description 会员等级列表
 * @param params
 * @returns {*}
 */
export function gradeList(params) {
    return request({
        url: '/membershipLevelConfig/getMembershipLevelConfigList',
        method: 'GET',
        params
    })
}

/**
 * @description 会员等级删除
 * @param data
 * @returns {*}
 */
export function deleteGradeRow(data) {
    return request({
        url: '/membershipLevelConfig/saveMembershipLevelConfig',
        method: 'POST',
        data
    })

}

/**
 * @description 会员等级详情
 * @param id
 * @returns {*}
 */
export function gradeDetail(id) {
    return request({
        url: '/membershipLevelConfig/getMembershipLevelConfigInfoById',
        method: 'GET',
        params: {id}
    })
}

/**
 * @description 会员等级新增/编辑
 * @param data
 * @returns {*}
 */
export function saveGrade(data) {
    return request({
        url: '/membershipLevelConfig/saveMembershipLevelConfig',
        method: 'POST',
        data
    })
}

export function getRightsList() {
    return request({
        url: '/membershipPrivilegeConfig/getMembershipPrivilegeConfig',
        method: 'GET'
    })
}
